#include "process.h"
#include <string.h>
#include <unistd.h>

#define SIZE 101
#define STYLE '='

void process()
{   
    int rate = 0;
    char buffer[SIZE];   
    memset(buffer , 0 , sizeof(buffer));
    const char* lable = "|/-\\";  
    int len = strlen(lable);

    while(rate <= 100)
    {
        printf("[%-100s][%d%%][%c]\r",buffer,rate,lable[rate%len]);
        fflush(stdout);
        buffer[rate] = STYLE;
        rate++;
        usleep(50000);
    }
   printf("\n");

}

